<template>
	<view>
		<view class="wrapper">
			<view class="blank24"></view>
			<view class="box wrapper">
				<view class="blank20"></view>
				<view class="flex">
					<view class="text-light-gray">
						日期：
					</view>
					<view class="">
						04/25
					</view>
					<view class="flex-1"></view>
					<view class="text-light-gray">
						时间：
					</view>
					<view class="">
						午餐（11:00）
					</view>
				</view>
				<view class="blank20"></view>
				<u-line></u-line>
				<view class="blank20"></view>
				<view class="flex justify-between">
					<view class="text-green font-bold">
						未开始
					</view>
					<view class="flex">
						<u-button type="error" size="mini" text="取消" @click="cancel"></u-button>
					</view>
				</view>
				<view class="blank20"></view>
			</view>
			<view class="blank24"></view>
			<view class="box wrapper">
				<template v-for="v in list">
					<view class="blank20"></view>
					<view class="flex">
						<u--image src="https://cdn.uviewui.com/uview/album/1.jpg" shape="square" radius="8" width="50" height="50"></u--image>
						<view class="flex-1 ml15">
							<view class="text-ellipsis">
								回锅肉
							</view>
							<view class="blank10"></view>
							<view class="font-24 text-ellipsis text-gray">
								猪后臀肉（二刀肉）、青椒、蒜苗等
							</view>
						</view>
						<view class="flex text-primary font-bold">
							x1
						</view>
					</view>
					<view class="blank20"></view>
					<u-line color="#e6e6e6"></u-line>
				</template>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		common_delete
	} from '@/common/api.js';
	export default {
		data() {
			return {
				list:[]
			}
		},
		methods: {
			cancel(){
				this.$store.dispatch('modal', {
					content:'确定取消该订单？',
					cancelText:'暂不取消',
					confirmText:'确定取消'
				}).then(() => {
					this.common_delete();
				}).catch(() => {
				
				}).finally(() => {
				
				})
			},
			common_delete(){
				let id = this.id;
				uni.showLoading({
					title: '加载中'
				});
				let data = {};
				common_delete({
					ids:[id],
					'model_name': 'packed_order_record',
				}).then((res) => {
					this.$store.dispatch('modal', {
						content:'删除成功',
						showCancel:false
					}).then(res=>{
						uni.navigateTo();
					})
				}).catch((res) => {
					this.$store.dispatch('modal', {
						content:'删除失败',
						showCancel:false
					});
					
				}).finally(() => {
					uni.hideLoading();
				})
			},
			getData(){
				this.list = [
					{statusStr:'较重',status:0},
					{statusStr:'一般',status:2},
					{statusStr:'严重',status:1},
				]
			}
			
		},
		onLoad() {
			this.getData();
		}
	}
</script>

<style>

</style>
